package com.fa4j.product.stock.repository.impl;

import com.fa4j.common.data.repository.impl.BaseRepositoryImpl;
import com.fa4j.product.stock.model.Stock;
import com.fa4j.product.stock.repository.StockRepository;
import com.fa4j.product.stock.repository.mapper.StockMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 持久化接口实现-商品库存
 *
 * @since 2025-11-22 21:06:24
 */
@Repository
public class StockRepositoryImpl extends BaseRepositoryImpl<StockMapper, Stock> implements StockRepository {

    @Override
    public List<Stock> queryByItemId(Integer id) {
        return super.lambdaQuery().eq(Stock::getItemId, id).list();
    }

    @Override
    public List<Stock> queryBySpecIds(List<Integer> specIds) {
        return super.lambdaQuery()
                .in(Stock::getSpecId, specIds)
                .list();
    }

}


